<template>
  <div>
    <p>{{msg}}</p>
    <p>{{num}}</p>
    <p>{{user.name}}</p>
    <p>{{user.age}}
    </p>
    <p>{{country.city}}</p>
  </div>
</template>

<script setup>
import {ref,reactive, toRef} from "vue"
let msg = ref("这是修改前的值");
let num = ref(20);
let user = reactive({
  name: "刘洋",
  age:22
})
let country=reactive({
    city:"北京"
})
let city=toRef(country,"city")
setTimeout(()=>{
  console.log("msg是"+msg);
  msg.value = "这是修改后的值";
  console.log("msg是"+msg);
  num.value = 30;
  user.name = "刘洋+2430150241"
  user.age=23
  city.value="上海"
},5000)
</script>